/**
 * 导入环境变量
 */
import Env from '@/env/index';

/**
 * 获取请求地址
 * @param url 请求地址
 * @returns {string} 请求地址
 */
function getRequsetBaseUrl(url: string): string {
  let requestMap = new Map<ViteEnv, string>();
  requestMap.set('development', '');
  requestMap.set('test', '');
  requestMap.set('staging', '');
  requestMap.set('production', '');
  let env: ViteEnv = Env.getServiceEnvironment();
  let baseUrl: string = requestMap.get(env) || '';
  return `${baseUrl}${url}`;
}

/**
 * 导出方法
 */
export default getRequsetBaseUrl;
